<template>
	<view>
		<view class="news">
			<u-navbar
				:title="title"
				:placeholder="true"
				:autoBack="true"
			>
			</u-navbar>
		</view>
		<view class="newslist">
			<view class="newsitem" v-for="(item,index) in list" :key="index" @click="jump(`/pageB/noticeList/noticeInfo?id=${item.id}&type=${type}&name=${$t('otc.name33')}`)">
				<view class="flex">
					<image src="/static/Group1410135821@2x.png" mode=""></image>
					<view class="newsitem-right">
						<view class="newsitem-right-title">{{item.name?item.name:$t('news.name')}}</view>
						<view class="newsitem-right-content">{{item.title}}</view>
					</view>
				</view>
				<view class="newsitem-right-time">{{item.createtime}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[],
				title:''
			}
		},
		onLoad(options) {
			const phoneInfo = uni.getSystemInfoSync(); // 获取手机系统信息
			this.scrollheight = uni.getWindowInfo().windowHeight
			this.title=options.name
			uni.setNavigationBarTitle({
				title: options.name
			})
			
			// 新闻
			this.type = options.type
			this.$fun.ajax.post('news/index', {
				type: options.type
			}).then(res => {
				this.list = res.data;
			})
			// this.list=[{title:"kkkkkk",createtime:2222},{name:"系统",title:"kkkkkkkkkkkkkkkkkkkkkkkkkkkk",createtime:2222222222}]
		},
		methods: {
			jump(url) {
				this.$fun.jump(url)
			}
		}
	}
</script>

<style lang="scss">
    .news {
		background:  url('../../static/newsbg.png') no-repeat;
		width: 100%;
		height: 100%;
		background-size: 100% 100%;
	}
	.newslist{
		margin-top: 20rpx;
		.newsitem{
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 20rpx 50rpx;
			image{
				width: 80rpx;
				height: 80rpx;
			}
			.newsitem-right{
				margin-left: 20rpx;
				.newsitem-right-title{
					font-size: 32rpx;
					font-family: PingFang SC;
					font-weight: bold;
					color: #232323;
				}
				.newsitem-right-content{
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #999999;
					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;
					width: 400rpx;
				}
			}
			.newsitem-right-time{
				font-size: 24rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #999999;
			}
		}
	}
</style>
